#ifndef   M_Code_THREADEDTASK_H
#define   M_Code_THREADEDTASK_H

class cbThreadedTask {
  public:
    cbThreadedTask();
    virtual ~cbThreadedTask() = 0;
    void Abort();
    virtual int Execute() = 0;
  protected:
    bool TestDestroy() const;
    bool Aborted() const;
  private:
    bool m_abort;
};

inline cbThreadedTask::cbThreadedTask()
  : m_abort( false ) {
}

inline cbThreadedTask::~cbThreadedTask() {
}

inline bool cbThreadedTask::TestDestroy() const {
  return m_abort;
}

inline bool cbThreadedTask::Aborted() const {
  return m_abort;
}

inline void cbThreadedTask::Abort() {
  m_abort = true;
}

#endif
